package com.xxxy.quartz;

import com.xxxy.utils.SpringApplicationUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;

public class StartQuartz implements Job {

    ExamQuartzService examQuartzService = SpringApplicationUtils.getBean(ExamQuartzService.class);

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobKey jobKey = jobExecutionContext.getJobDetail().getKey();
        Integer id =  Integer.parseInt(jobKey.getName().replace("start",""));
        examQuartzService.start(id);
    }
}
